# for循环
# 作用：遍历可迭代的数据[str, list, tuple, dict]
# 遍历：将容器中的数据依次获取
# TODO for循环语法
list1 = ['python', 'git', 'mysql', 'linux']
"""
for 临时变量 in 要遍历的数据:
    代码块：临时变量
"""
# list
for item in list1:
    print(item)

print('==' * 20)

str1 = 'hello'
for char in str1:
    print(char)

# TODO 列表嵌套
list1 = [
    ['python', 'mysql', 'linux'],
    ['html', 'css', 'javascript']
]
print(list1)  # [['python', 'mysql', 'linux'], ['html', 'css', 'javascript']]
# for
for sub_list in list1:
    for item in sub_list:
        print(item)